package org.testis.gui.mvc.model.testdesign;

import org.testis.gui.mvc.model.*;
import org.testis.gui.mvc.controller.testdesign.TestSuiteController;


/**
 *
 * @author Cahit Emir Erel
 */
public class TestSuiteModel extends AbstractModel
{

    private Boolean m_testSuiteVisibility = false;
    private Integer m_timeout = 0;
    private String m_name = "";
    private String m_description = "";


    public String getName()
    {
        return m_name;
    }


    public void setName(String name)
    {
        if (name == null) {
            name = "";
        }
        String oldName = m_name;
        m_name = name;
        firePropertyChange(TestSuiteController.CHANGE_NAME,
                           oldName,
                           name);
    }


    public String getDescription()
    {
        return m_description;
    }


    public void setDescription(String description)
    {
        if (description == null) {
            description = "";
        }
        String oldDescription = m_description;
        m_description = description;
        firePropertyChange(TestSuiteController.CHANGE_DESCRIPTION,
                           oldDescription,
                           description);
    }


    public Integer getTimeout()
    {
        return m_timeout;
    }


    public void setTimeout(Integer timeout)
    {
        if (timeout != null) {
            Integer oldTimeout = m_timeout;
            m_timeout = timeout;
            firePropertyChange(TestSuiteController.CHANGE_TIMEOUT,
                               oldTimeout,
                               timeout);
        }
    }


    public void setTestSuiteVisibility(Boolean testSuiteVisibility)
    {
        if (testSuiteVisibility != null) {
            Boolean oldTestSuiteVisibility = m_testSuiteVisibility;
            m_testSuiteVisibility = testSuiteVisibility;
            firePropertyChange(TestSuiteController.SHOW_ADD_TEST_SUITE,
                               oldTestSuiteVisibility,
                               testSuiteVisibility);
        }
    }


    public Boolean getTestSuiteVisibility()
    {
        return m_testSuiteVisibility;
    }
}
